<?php
class web extends core
{
	/**
	*前台首页
	*@author ：刘旭
	**/
	final static public function index()
	{
		//用户是否登陆
		$user=self::head();
		//右侧团购信息
		$rs_team=team::team_show();
		self::view(__FUNCTION__.".php",compact("user","rs_team"));
	}
	/**
	*往期团购
	*@author ：刘旭
	**/
	final static public function over_team()
	{
		//用户是否登陆
		$user=self::head();
		//右侧团购信息
		self::view(__FUNCTION__.".php",compact("user"));
	}
	
	/**
	*团购达人
	*@author ：刘旭
	**/
	final static public function customer()
	{
		//用户是否登陆
		$user=self::head();
		//右侧团购信息
		self::view(__FUNCTION__.".php",compact("user"));
	}


	/**
	*网站头部信息
	*判断用户是否登陆
	*@author ：刘旭
	**/
	final static function head(){
		if(!empty($_SESSION['user'])&&!empty($_SESSION['user_id'])){
			//用户的具体信息
			$user= $_SESSION['user'];
		}else {
			$user="";
		}
		return $user;
	}

	/**
	 * 用户登陆
	 *	@author 刘旭
	 */
	final static  public function log_in()
	{
		if($_SERVER['REQUEST_METHOD']=='POST')
		{
			$error=log::log_in();
			if(empty($error)){
				//self::index();
				header("Location: web.php?do=index"); 
			}
			else{
				self::view(__FUNCTION__.".php",compact("error"));
			}
		}
		else
		{
			self::view(__FUNCTION__.".php");
		}
	}
	
	/**
	 * 用户注销
	 * @author 刘旭
	 */
	final static public function log_out(){
		unset($_SESSION['user']);
		header("Location: web.php?do=index"); 
	}
	
	/**
	 * 用户注册
	 * @author 刘旭
	 */
	 
	final static public function register(){
		if($_SERVER['REQUEST_METHOD']=='POST')
		{
			$error=log::register();
			if(empty($error)){
				header("Location: web.php?do=index"); 
			}else{
				self::view(__FUNCTION__.".php",compact("error"));
			}
		}
		else 
		{
			self::view(__FUNCTION__.".php");
		}
	}
	
	/**********用户优惠券*******用户订单**********用户资料************/
	
	/**
	*用户的信息---优惠券
	*@author:刘旭
	**/
	final static function mydata_coupons(){
	        //用户是否登陆
		$user=self::head();
		if(!empty($user))
		{
		 self::view(__FUNCTION__.".php",compact("user"));
		}
		else
		{
		        header("location:web.php?do=index");
		}
	       
	}
	
	/**
	*用户的信息---订单
	*@author:刘旭
	**/
	final static function mydata_order(){
	         //用户是否登陆
		$user=self::head();
		if(!empty($user))
		{
		 self::view(__FUNCTION__.".php",compact("user"));
		}
		else
		{
		        header("location:web.php?do=index");
		}
	}
	
	/**
	*用户的信息---资料
	*@author:刘旭
	**/
	final static function mydata_information(){
	         //用户是否登陆
		$user=self::head();
		if(!empty($user))
		{
		 self::view(__FUNCTION__.".php",compact("user"));
		}
		else
		{
		        header("location:web.php?do=index");
		}
	}
	
	/*****************web footer 信息****************/
	
	/**
	*玩转乐团信息
	*@author刘旭
	**/
	
	final static function user_play(){
	        $user=self::head();
	        self::view(__FUNCTION__.".php",compact("user"));
	}
	
	/**
	*常见问题
	*@author刘旭
	**/
	
	final static function user_question(){
	        $user=self::head();
	        self::view(__FUNCTION__.".php",compact("user"));
	}
	
	/**
	*乐团概念
	*@author刘旭
	**/
	
	final static function user_concept(){
	       $user=self::head();
	        self::view(__FUNCTION__.".php",compact("user"));
	}
	
	
	/**
	*商务合作
	*@author刘旭
	**/
	
	final static function cooperation_business(){
	         $user=self::head();
	        self::view(__FUNCTION__.".php",compact("user"));
	}
	
	/**
	*友情链接
	*@author刘旭
	**/
	
	final static function cooperation_link(){
	         $user=self::head();
	        self::view(__FUNCTION__.".php",compact("user"));
	}
	
	/**
	*关于乐团
	*@author刘旭
	**/
	
	final static function about_letuan(){
	        $user=self::head();
	        self::view(__FUNCTION__.".php",compact("user"));
	}
	
	/**
	*工作机会
	*@author刘旭
	**/
	
	final static function about_job(){
	        $user=self::head();
	        self::view(__FUNCTION__.".php",compact("user"));
	}
	
	/**
	*联系方式
	*@author刘旭
	**/
	
	final static function about_contact(){
	         $user=self::head();
	        self::view(__FUNCTION__.".php",compact("user"));
	}
	
	
	/**
	*用户协议
	*@author刘旭
	**/
	
	final static function about_deal(){
	         $user=self::head();
	        self::view(__FUNCTION__.".php",compact("user"));
	}
	
}

?>
